package wang.wangby.lazydoc.model;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import ch.qos.logback.classic.layout.TTLLLayout;
import lombok.Data;
import wang.wangby.annotation.Return;
import wang.wangby.lazydoc.common.DocParameterType;
import wang.wangby.lazydoc.common.DocRules;

public class ApiResult {
	private Return config;
	private DocParameterType type;
	private ApiInfo apiInfo;
	
	public ApiResult(ApiInfo apiInfo,DocParameterType type,Return config) {
		this.apiInfo=apiInfo;
		this.type=type;
		this.config=config;
	}
	
	
	public String getTypeName() {
		return type.getTypeName();
	}
	
	public ApiParameter getParameter() {
		String desc="";
		if(config!=null&&config.value()!=null) {
			desc=config.value();
		}else {
			desc="返回值";
		}
		
		ApiParameter pa=new ApiParameter(apiInfo.getDocRules(),type,"return",desc,null);
		return pa;
	}

}
